﻿/*
#**************************************************************************
#  openSIS is a student information system for public and non-public 
#  schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
#  openSIS is  web-based, open source, and comes packed with features that 
#  include student demographic info, scheduling, grade book, attendance, 
#  report cards, eligibility, transcripts, parent portal, 
#  student portal and more.   
#
#  Visit the openSIS web site at http://www.opensis.com to learn more.
#  If you have question regarding this system or the license, please send 
#  an email to info@os4ed.com.
#
#  This program is released under the terms of the GNU General Public License  
#  as  published by the Free Software Foundation, version 2 of the License. 
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************** 

*/


function ValidateSchlCheckboxlist(sender, args) {
    var checked = 0;
    for (i = 0; i < document.aspnetForm.elements.length; i++) {
        if (document.aspnetForm.elements[i].name.indexOf("chkschools") > -1) {

            if (document.aspnetForm.elements[i].checked == true) {
                var checked = checked + 1;


            }

        }
    }
    if (checked == 0) {

        

        args.IsValid = false;
    }
}

function ValidateOpenAccessCheckboxlist(sender, args) {
    var checked = 0;
    for (i = 0; i < document.aspnetForm.elements.length; i++) {
        if (document.aspnetForm.elements[i].name.indexOf("chkOpenAccess") > -1) {

            if (document.aspnetForm.elements[i].checked == true) {
                var checked = checked + 1;


            }

        }
    }
    if (checked == 0) {

        

        args.IsValid = false;
    }
    if (checked == 2) {



        args.IsValid = false;
    }
}
function ValidateLibAccCheckboxlist(sender, args) {
    var checked = 0;
    for (i = 0; i < document.aspnetForm.elements.length; i++) {
        if (document.aspnetForm.elements[i].name.indexOf("chkLibAcc") > -1) {

            if (document.aspnetForm.elements[i].checked == true) {
                var checked = checked + 1;


            }

        }
    }
    if (checked == 0) {

       

        args.IsValid = false;
    }
    if (checked == 2) {



        args.IsValid = false;
    }
}


function GridCheckBoxSelectioneditstaff(culture) {

    var checked = 0;
    var sessionValue = culture;


    for (i = 0; i < document.aspnetForm.elements.length; i++) {
        if (document.aspnetForm.elements[i].name.indexOf("chk") > -1) {
            if (document.aspnetForm.elements[i].checked == true) {
                var checked = checked + 1;

            }

        }
    }
    if (checked > 1) {

        for (j = 0; j < document.aspnetForm.elements.length; j++) {
            if (document.aspnetForm.elements[j].name.indexOf("chk") > -1) {
                document.aspnetForm.elements[j].checked = false;
            }

        }



        if (sessionValue == "en-US") {
            alert('Please select only one row');
        }
        if (sessionValue == "es-MX") {
            alert('Por favor, elija sólo una fila');
        }
        if (sessionValue == "it-IT") {
            alert('Si prega di selezionare solo uno riga');
        }
        if (sessionValue == "de-DE") {
            alert('Bitte wählen Sie nur eine Zeile');
        }
        if (sessionValue == "fr-FR") {
            alert('vous plaît sélectionnez uniquement une rang');
        }
        if (sessionValue == "ru-RU") {
            alert('Пожалуйста, выберите только одну строку');
        }
        if (sessionValue == "pt-BR") {
            alert('agradar Selecione apenas uma fila');
        }
        if (sessionValue == "ja-JP") {
            alert('つだけ行を選択してください');
        }
        if (sessionValue == "ko-KR") {
            alert('제발 하나만 행을 선택 ');
        }
        if (sessionValue == "ar-SA") {
            alert('من فضلك رتخا فقط واحد صف');
        }
        if (sessionValue == "zh-CN") {
            alert('请仅选择一列行');
        }

        return false;


    }

    //*******

    else if (checked == 0) {


        //alert('Please select atleast one row');

        if (sessionValue == "en-US") {
            alert('Please select atleast one row');
        }
        if (sessionValue == "es-MX") {
            alert('Por favor, seleccione al menos una fila');
        }
        if (sessionValue == "it-IT") {
            alert('Si prega di selezionare almeno uno riga');
        }
        if (sessionValue == "de-DE") {
            alert('Bitte wählen Sie mindestens eine Zeile');
        }
        if (sessionValue == "fr-FR") {
            alert('vous plaît sélectionner au moins une rangée');
        }
        if (sessionValue == "ru-RU") {
            alert('Пожалуйста, выберите по крайней мере одну строку');
        }
        if (sessionValue == "pt-BR") {
            alert('agradar Selecione pelo menos uma fila');
        }
        if (sessionValue == "ja-JP") {
            alert('どうぞ選択少なくとも一つ行');
        }
        if (sessionValue == "ko-KR") {
            alert('이상이어야 하나의 행을 선택하시기 바랍니다 ');
        }
        if (sessionValue == "ar-SA") {
            alert('من فضلك رتخا على الأقل واحد صف');
        }
        if (sessionValue == "zh-CN") {
            alert('请选择至少一个行');
        }


        return false;
    }

    toolTip('');

}